package com.woniuxy.controller;

import com.woniuxy.entity.Chat;
import com.woniuxy.service.ChatService;
import com.woniuxy.utils.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/life/Chat")
public class ChatController {
    @Autowired
    private ChatService chatServiceImpl;

    /*
    *   查询聊天记录
    * */
    @GetMapping("/getChat")
    public ResponseResult<List<Chat>> getChat(
            @RequestParam("publisherId") Integer publisherId,
            @RequestParam("consumerId") Integer consumerId){
        return ResponseResult.success(chatServiceImpl.getChat(publisherId,consumerId));
    }
}
